<!DOCTYPE html> 
<html lang="en"> 
<head> 
<meta charset="UTF-8"> 
<meta name="viewport" content="width=device-width, initial-scale=1.0"> 
<title>示例11</title> 
<script> 
// 代码 1：提取对象中的属性，并赋值给同名变量 
let {title, version}={version:"ECMAScript 6.0", title:"对象解构赋值"}; 
console.log(title); // 对象解构赋值 
console.log(version); //ECMAScript 6.0 

// 代码 2：对象中不存在的属性，值为 undefined 
let {message} = {version:"ECMAScript 6.0", title:"对象解构赋值"}; 
console.log(message); //undefined 
 
 // 代码 3：提取对象中的属性，并赋值给非同名的变量 
 let {title:msg,version:ver}={version:"ECMAScript 6.0", title:"对象解构赋值"}; 
 console.log(ver); //ECMAScript 6.0 
 console.log(msg); //对象解构赋值 
 </script>  
 </head> 
 <body></body> 
 </html> 